package br.ufrn.btest.decorators.expressions;

import de.be4.classicalb.core.parser.node.AAddExpression;
import de.be4.classicalb.core.parser.node.ABoolSetExpression;
import de.be4.classicalb.core.parser.node.ACardExpression;
import de.be4.classicalb.core.parser.node.ADomainExpression;
import de.be4.classicalb.core.parser.node.AEmptySetExpression;
import de.be4.classicalb.core.parser.node.AFalseExpression;
import de.be4.classicalb.core.parser.node.AFinSubsetExpression;
import de.be4.classicalb.core.parser.node.AFunctionExpression;
import de.be4.classicalb.core.parser.node.AIdentifierExpression;
import de.be4.classicalb.core.parser.node.AImageExpression;
import de.be4.classicalb.core.parser.node.AIntSetExpression;
import de.be4.classicalb.core.parser.node.AIntegerExpression;
import de.be4.classicalb.core.parser.node.AIntersectionExpression;
import de.be4.classicalb.core.parser.node.AIntervalExpression;
import de.be4.classicalb.core.parser.node.ALambdaExpression;
import de.be4.classicalb.core.parser.node.AMaxIntExpression;
import de.be4.classicalb.core.parser.node.AMinusOrSetSubtractExpression;
import de.be4.classicalb.core.parser.node.AMultOrCartExpression;
import de.be4.classicalb.core.parser.node.ANat1SetExpression;
import de.be4.classicalb.core.parser.node.ANatSetExpression;
import de.be4.classicalb.core.parser.node.APartialFunctionExpression;
import de.be4.classicalb.core.parser.node.APartialInjectionExpression;
import de.be4.classicalb.core.parser.node.APowSubsetExpression;
import de.be4.classicalb.core.parser.node.ARangeExpression;
import de.be4.classicalb.core.parser.node.AReverseExpression;
import de.be4.classicalb.core.parser.node.ASetExtensionExpression;
import de.be4.classicalb.core.parser.node.AStringSetExpression;
import de.be4.classicalb.core.parser.node.ATotalFunctionExpression;
import de.be4.classicalb.core.parser.node.ATrueExpression;
import de.be4.classicalb.core.parser.node.AUnaryExpression;
import de.be4.classicalb.core.parser.node.AUnionExpression;
import de.be4.classicalb.core.parser.node.PExpression;

public class MyExpressionFactory {

	public static MyExpression convertExpression(PExpression expression) {
		if (expression instanceof AIdentifierExpression) {
			return new MyAIdentifierExpression((AIdentifierExpression) expression);
		} else if (expression instanceof AIntSetExpression) {
			return new MyAIntSetExpression((AIntSetExpression) expression);
		} else if (expression instanceof AStringSetExpression) {
			return new MyAStringSetExpression((AStringSetExpression) expression);
		} else if (expression instanceof ABoolSetExpression) {
			return new MyABoolSetExpression((ABoolSetExpression) expression);
		} else if (expression instanceof ANatSetExpression) {
			return new MyANatSetExpression((ANatSetExpression) expression);
		} else if (expression instanceof ANat1SetExpression) {
			return new MyANat1SetExpression((ANat1SetExpression) expression);
		} else if (expression instanceof AIntegerExpression) {
			return new MyAIntegerExpression((AIntegerExpression) expression);
		} else if (expression instanceof ATrueExpression) {
			return new MyATrueExpression((ATrueExpression) expression);
		} else if (expression instanceof AFalseExpression) {
			return new MyAFalseExpression((AFalseExpression) expression);
		} else if (expression instanceof AMaxIntExpression) {
			return new MyAMaxIntExpression((AMaxIntExpression) expression);
		} else if (expression instanceof AAddExpression) {
			return new MyAAddExpression((AAddExpression) expression);
		} else if (expression instanceof AFunctionExpression) {
			return new MyAFunctionExpression((AFunctionExpression) expression);
		} else if (expression instanceof ATotalFunctionExpression) {
			return new MyATotalFunctionExpression((ATotalFunctionExpression) expression);
		} else if (expression instanceof APartialInjectionExpression) {
			return new MyAPartialInjectionExpression((APartialInjectionExpression) expression);
		} else if (expression instanceof AFinSubsetExpression) {
			return new MyAFinSubsetExpression((AFinSubsetExpression) expression);
		} else if (expression instanceof AEmptySetExpression) {
			return new MyAEmptySetExpression((AEmptySetExpression) expression);
		} else if (expression instanceof AIntersectionExpression) {
			return new MyAIntersectionExpression((AIntersectionExpression) expression);
		} else if (expression instanceof AUnionExpression) {
			return new MyAUnionExpression((AUnionExpression) expression);
		} else if (expression instanceof ASetExtensionExpression) {
			return new MyASetExtensionExpression((ASetExtensionExpression) expression);
		} else if (expression instanceof ARangeExpression) {
			return new MyARangeExpression((ARangeExpression) expression);
		} else if (expression instanceof ADomainExpression) {
			return new MyADomainExpression((ADomainExpression) expression);
		} else if (expression instanceof AImageExpression) {
			return new MyAImageExpression((AImageExpression) expression);
		} else if (expression instanceof AReverseExpression) {
			return new MyAReverseExpression((AReverseExpression) expression);
		} else if (expression instanceof ACardExpression) {
			return new MyACardExpression((ACardExpression) expression);
		} else if (expression instanceof APowSubsetExpression) {
			return new MyAPowSubsetExpression((APowSubsetExpression) expression);
		} else if (expression instanceof AMinusOrSetSubtractExpression) {
			return new MyAMinusOrSetSubtractExpression((AMinusOrSetSubtractExpression) expression);
		} else if (expression instanceof AIntervalExpression) {
			return new MyAIntervalExpression((AIntervalExpression) expression);
		} else if (expression instanceof AMultOrCartExpression) {
			return new MyAMultOrCartExpression((AMultOrCartExpression) expression);
		} else if (expression instanceof ALambdaExpression) {
			return new MyALambdaExpression((ALambdaExpression) expression);
		} else if (expression instanceof APartialFunctionExpression) {
			return new MyAPartialFunctionExpression((APartialFunctionExpression) expression);
		} else if (expression instanceof AUnaryExpression) {
			return new MyAUnaryExpression((AUnaryExpression) expression);
		} else {
			System.out.println("No decorator for: " + expression.getClass().getName());
			return null;
		}
	}
	
}
